import java.util.Scanner;

public class Challenge4//Calculator!
{
	public static void main(String[] args)
	{
		Scanner inputScanner = new Scanner(System.in);
		String inputString = "";
		double num1 = 0, num2 = 0, runningTotal = 0;
		
		System.out.print("Number: ");
		inputString = inputScanner.next();
		num1 = Double.parseDouble(inputString);
		runningTotal = num1;
		
		while(true)
		{
			System.out.print("Operator: ");
			inputString = inputScanner.next();
			
			switch(inputString)
			{
				case "+":
					System.out.print("Number: ");
					inputString = inputScanner.next();
					num2 = Double.parseDouble(inputString);
					runningTotal += num2;
					break;
				case "-":
					System.out.print("Number: ");
					inputString = inputScanner.next();
					num2 = Double.parseDouble(inputString);
					runningTotal -= num2;
					break;
				case "*":
					System.out.print("Number: ");
					inputString = inputScanner.next();
					num2 = Double.parseDouble(inputString);
					runningTotal *= num2;
					break;
				case "/":
					System.out.print("Number: ");
					inputString = inputScanner.next();
					num2 = Double.parseDouble(inputString);
					runningTotal /= num2;
					break;
				default:
					System.out.println("Invalid operator. Try again.");
			}
			
			System.out.println("Running Total: " + runningTotal);
		}		
	}
}
